/**
 * 功能描述: 滑动选择器样式表
 * @author 崔孝楠
 * @date 2022/9/28 13:35
 * @version 1.0
 */
@import '../../style/index.scss';

// 刻度标记布局
@mixin slider-mark--layout {
  position: absolute;
  top: 14px;
  left: 0;
  width: 100%;
}

// 标记文本布局
@mixin slider-mark-text--layout {
  position: absolute;
  display: inline-block;
  text-align: center;
  transform: translateX(-50%);
  word-break: keep-all;
}

// 纵向滑动条布局
@mixin slider-vertical--layout {
  width: 12px;
  height: 100%;
  margin: 6px 10px;
  padding: 0 4px;

  //轨道
  @include b(slider-rail) {
    width: 4px;
    height: 100%;
  }

  // 激活部分
  @include b(slider-track) {
    width: 4px;
  }

  // 拖动按钮
  @include b(slider-handle) {
    margin-top: -6px;
    margin-left: -5px;
  }

  // 刻度标记
  @include b(slider-mark) {
    top: 0;
    left: 12px;
    width: 18px;
    height: 100%;
  }

  // 标记文本
  @include b(slider-mark-text) {
    left: 4px;
    white-space: nowrap;
    transform: translateY(50%);
  }

  // 间隔点外部容器
  @include b(slider-step) {
    width: 4px;
    height: 100%;
  }

  // 间隔点
  @include b(slider-dot) {
    top: auto;
    left: 2px;
    margin-bottom: -4px;
  }

  // 设置标记时外边距
  &.#{$namespace}-slider-with-marks{
    margin-right: 28px;
  }

}

// 有标记的滑块外边距
@include b(slider-with-marks) {
  margin-bottom: 28px;
}

// 刻度标记样式
@include b(slider-mark) {
  font-size: $font-size-base;
  @include slider-mark--layout;
}

// 标记文本样式
@include b(slider-mark-text) {
  color: $color-info;
  cursor: pointer;
  -webkit-user-select: none;
  -moz-user-select: none;
  user-select: none;
  @include slider-mark-text--layout;
}

// 激活状态文本颜色
@include b(slider-mark-text-active) {
  color: $color-text-primary;
}

// 纵向滑动条样式
@include b(slider-vertical) {
  @include slider-vertical--layout;
}
